#ifndef GLHELPER_H
#define GLHELPER_H

//LIB INCLUDES
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <math.h>
#include <unistd.h>
#include <ctime>
#include "types.hpp"

//GLOBAL

void initCore();
void drawSquare(int side);
void drawTeapot(float angle, float state);
void drawCrap();
void drawCircle(float rad);


void normalize(s_vector &v);

inline float dotProduct(s_vector v1, s_vector v2) {
    return v1.x*v2.x + v1.y*v2.y;
}
inline float absVector(s_vector v) {
    return pow(v.x*v.x + v.y*v.y, 0.5f);
}
inline float getMag(s_vector v) {
    return pow(v.x*v.x + v.y*v.y, 0.5f);
}
inline float getAngle(s_vector v1, s_vector v2) {
    return acos( dotProduct(v1, v2) / absVector(v1) / absVector(v2) );
}


inline s_vector operator* (float const& scalar, s_vector const& v){
    return (s_vector){v.x * scalar, v.y * scalar};
}
inline s_vector operator+ (s_vector const& v1, s_vector const& v2){
    return (s_vector){v1.x + v2.x, v1.y + v2.y};
}
inline s_vector operator- (s_vector const& v1, s_vector const& v2){
    return (s_vector){v1.x - v2.x, v1.y - v2.y};
}

#endif

